<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-touch-fullscreen" content="yes" />
		<meta name="format-detection" content="telephone=no"/>
		<meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
		<meta name="msapplication-tap-highlight" content="no" />
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width, viewport-fit=cover" />
		<title>启蒙优选-订单详情</title>
		<link rel="stylesheet" href="__TMPL__/home/public/assets/css/style.css" />
		<link rel="stylesheet" href="__TMPL__/home/public/assets/css/swiper.min.css">
	</head>
	<body>
		<!-- 个人中心 --> 
		<div class="orderDetailIndex">
			<div class="bg_color"></div>
			<div class="content">
				<!-- <div class="order_top">
					<div class="title flex juscbtween">
						<a href="javascript:history.go(-1);" class="flex alitemCenter"><img src="__TMPL__/home/public/assets/img/back.png" alt=""></a>
						<b>订单详情</b>
						<span></span>
					</div>
				</div> -->
				<!-- 发货信息 -->
				<div class="deliver">
					<div class="shop_info">
						<div class="flex juscbtween">
							<h3>
								<if condition="$info.status eq 1">
									付款成功，等待发货
								<elseif condition="$info.status eq 2" />	
									卖家已发货
								<elseif condition="$info.status eq 3" />
									退款中	
								<elseif condition="$info.status eq 4" />
									交易成功	
								<elseif condition="$info.status eq 5" />	
									交易关闭
								<else/>	
									错误状态
								</if>
							</h3>
							<img src="__TMPL__/home/public/assets/img/customer.png" alt="" class="contactKefu">
						</div>
						<p>
							<if condition="$info.status eq 2">
								<php>
									$time = (strtotime($info['dispatch_time']) + 86400 * 10) - time();	
								</php>
                    		还剩<php>echo intval($time / 86400); </php>天<php>echo intval(($time%86400) / 3600); </php>时自动确认收货
                    			<php></php>
							</if>
							
						</p>
					</div>

					<if condition="$info.status neq 1 AND $info.status neq 5">
					<div class="deliver_info">
						<div class="title">发货信息</div>
						<div class="exchange flex juscbtween">
							<div class="left flex alitemCenter">
								<if condition ="$info.status gt 1">
									<if condition = "$info.course.attend_type eq 1">
										<div class="code">手机号：<i id="_number">{$info.mobile}</i></div><img src="__TMPL__/home/public/assets/img/copy.png" alt="" id="copyNum">
									<else />
										<notempter name="$info.code_info">
											<div class="code">兑换码：<i id="_number"><notempty name="$info.code_info">{$info.code_info.code_name}</notempty></i></div><img src="__TMPL__/home/public/assets/img/copy.png" alt="" id="copyNum">
										</notempter>
										
									</if>
								</if>
								
							</div>
							<a href="./course_way?course_id={$info.course.id}&order_id={$info.order_id}" class="right">去上课</a>
						</div>
					</div>
					</if>
					
					<div class="good_info">
						<div class="title">商品信息</div>
						<a href="/course_details?course_id={$info.course.id}&invite_code={$invite}"><div class="order_info flex juscbtween">
							<div class="order_img">
								<img src="{$info.course.xt_logo}" alt="">
							</div>
							<div class="right flex flexdirection juscbtweenOnly">
								<h4 class="ellipsis">{$info.course.title}</h4>
								<div class="money flex juscbtween">
									<div class="pay_money">
										<p><i>￥</i>{$info.pay_money}</p>
										<span>付款金额</span>
									</div>
									<!--<div class="get_money">
										<p><i>￥</i>999</p>
										<span>预估收益</span>
									</div>-->
								</div>
							</div>
						</div></a>
						<div class="buttonList textRight flex juscbtween">
							<div></div>
							<div class="flex alitemCenter">
								<!--<if condition="$info.status eq 1 OR $info.status eq 2">
									<button class="hui">退款</button>
								</if>-->

								<if condition="$info.status eq 2">
									<form action='/order_submit' method='post' class="flex">
										<input type="hidden" name="order_id" value="{$info.order_id}" />
										<button type="submit" class="red">确认收货</button>
									</form>
									
								</if>
							</div>
						</div>
					</div>
					<div class="good_info_two">
						<div class="title">订单信息</div>
						<div class="info_item flex juscbtween">
							<p>订单编号：<i id="_order_umber">{$info.order_number}</i></p>
							<span id="copyOrderNum">复制</span>
						</div>
						<div class="info_item"><p>收货人：{$info.recipients}</p></div>
						<div class="info_item"><p>手机号：{$info.mobile}</p></div>
						<div class="info_item"><p>收货地址：{$info.province}{$info.city}{$info.district}{$info.site}</p></div>
						<div class="info_item"><p>支付方式：<if condition="$info.pay_type eq 1">微信<else />余额</if></p></div>
						<div class="info_item"><p>支付时间：{$info.pay_time}</p></div>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/jquery-2.0.3.min.js"></script>
	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/layer/layer.js"></script>
  	<script rel="stylesheet" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/base.js"></script>
	<script>
		$(function(){
			//复制兑换码
		   	$('#copyNum').on('click', function () {
			    var val = document.getElementById('_number');
			    window.getSelection().selectAllChildren(val);
			    var copyCode = document.execCommand("Copy");

			    if (copyCode) {
			      layer.msg('复制成功');
			    } else {
			      layer.msg('复制失败');
			    }
			});

		   	//复制订单编号
		   	$('#copyOrderNum').on('click', function () {
			    var val = document.getElementById('_order_umber');
			    window.getSelection().selectAllChildren(val);
			    var copyCode = document.execCommand("Copy");

			    if (copyCode) {
			      layer.msg('复制成功');
			    } else {
			      layer.msg('复制失败');
			    }
			});

			//点击联系客服
			$('.contactKefu').click(function(){
				layer.msg('请在启蒙优选公众号联系客服')
			})
		})
	</script>
</html>
